<!DOCTYPE html>
<html lang="zh-CN">
  <head>
    <meta charset="UTF-8" />
    <meta name="viewport" content="width=device-width, initial-scale=1.0" />
    <title>Document</title>
  </head>
  <body>
    <script>
      // 需求：求员工的工资，第一个参数是员工的级别工资，第二个参数是员工的绩效
      // getSalary(12000, 1000);
      // getSalary(12000, 500);
      // getSalary(15000, 3000);
      // getSalary(15000, 4000);

      function makeSalary(base) {
        return function (performance) {
          return base + performance;
        };
      }

      let getSalary1 = makeSalary(12000);
      let getSalary2 = makeSalary(15000);
      console.log('==>', getSalary1(1000));
      console.log('==>', getSalary1(500));
      console.log('==>', getSalary2(3000));
      console.log('==>', getSalary2(4000));
    </script>
  </body>
</html>
